package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.TravelQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface TravelMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Travel entity);

    Travel selectByPrimaryKey(Long id);

    List<Travel> selectAll();

    int updateByPrimaryKey(Travel entity);


    List<Travel> selectForList(QueryObject qo);


    Travel selectById(Long id);

    void updateState(Travel travel);


    int selectCountByKeyword(TravelQueryObject qo);
    List<Travel> selectTravelById(Long UserId);

    Map selectCollectByUserId(@Param("userId") Long userId, @Param("travelId") Long travelId);

    void saveCollect(@Param("userId") Long userId, @Param("travelId") Long travelId);

    void deleteCollect(@Param("userId") Long userId, @Param("travelId") Long travelId);

    void updateWatchNum(@Param("userId") int userId, @Param("num") int num);

    void updateVisitNum(@Param("userId") int userId, @Param("num") int num);
}